
public class Test {
    public static void main(String[] args) {
        char[] ch = new char[]{'a','b','c'};
        String s1 = new String(ch);
        s1.intern();
        String s2 = "abc";
        System.out.println(s1 == s2);

    }
    public static void main6(String[] args) {
        String s1 = "helloworld!";

        boolean ret1 = s1.endsWith("ld!");
        System.out.println(ret1);

        boolean ret2 = s1.startsWith("h");
        System.out.println(ret2);
    }
    public static void main5(String[] args) {
        String s1 = "helloworld!";
        boolean flag = s1.contains("hello");
        System.out.println(flag);
    }
    public static void main4(String[] args) {
        String s1 = "    hello  world      ";
        System.out.print(s1);
        System.out.println("world!");

        String ret = s1.trim();
        System.out.print(ret);
        System.out.println("world!");
    }
    public static void main3(String[] args) {
        String s1 = "helloworld";
        String ret1 = s1.substring(3);
        System.out.println(ret1);

        String ret2 = s1.substring(3,7);
        System.out.println(ret2);
    }
    public static void main2(String[] args) {
        String s1 = "name=zhangsan&age=18";
        String[] ret = s1.split("&|=");
        for (String x : ret) {
            System.out.println(x);
        }
    }
    public static void main1(String[] args) {
        String s1 = "name=zhangsan&age=18";
        String[] ret = s1.split("&");
        for (String x : ret) {
            String[] ret2 = x.split("=");
            for (String ss : ret2) {
                System.out.println(ss);
            }
        }
    }
}
